home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DeveloperStax.cpt / Developer Stack 1.0 / card_5204.txt < prev    next >
Text File  |  1989-02-26  |  3KB  |  128 lines

  1. -- card: 5204 from stack: in.0
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 2612
  5. -- name: DeProtect
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: A004
  11. -- rect: left=224 top=243 right=293 bottom=283
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 27056 / 27056
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Try It
  20. ----- HyperTalk script -----
  21. on mouseUp
  22.   if the optionkey is down then
  23.     pass mouseup
  24.   end if
  25.  
  26.   put "Please select a protected stack"
  27.   set cursor to 4
  28.   put filename("STAK") into fname
  29.   if fname is empty then
  30.     hide message window
  31.     exit mouseUp
  32.   end if
  33.  
  34.   deprotect fname
  35.  
  36.   if the result is empty
  37.   then answer "Deprotect Successful" with "OK"
  38. else if the result is -49
  39. then answer "Sorry, that file is busy."
  40. else if the result is -44
  41. then answer "Sorry, the disk is locked."
  42. else answer "Failed: unexpected file system error: " & the result with "OK"
  43. end mouseUp
  44.  
  45.  
  46.  
  47. -- part 2 (button)
  48. -- low flags: 00
  49. -- high flags: A003
  50. -- rect: left=82 top=302 right=324 bottom=182
  51. -- title width / last selected line: 0
  52. -- icon id / first selected line: 0 / 0
  53. -- text alignment: 1
  54. -- font id: 0
  55. -- text size: 12
  56. -- style flags: 0
  57. -- line height: 16
  58. -- part name: Install
  59. ----- HyperTalk script -----
  60. on mouseUp
  61.   if the optionkey is down then
  62.     pass mouseup
  63.   end if
  64.  
  65.   put (long name of this stack) into sourceStack
  66.   delete first word of sourceStack
  67.   delete first character of sourceStack
  68.   delete last character of sourceStack
  69.   put "Select a stack to copy this resource into."
  70.   put filename("STAK") into fname
  71.   if fname is empty then
  72.     hide message window
  73.     exit mouseup
  74.   end if
  75.   if sourcestack=fname then
  76.     beep
  77.     Answer "Get real.  You can't install it in this stack"
  78.     hide message window
  79.     exit mouseup
  80.   end if
  81.  
  82.   --
  83.   ModResCopy sourceStack,fname,"XCMD","DeProtect"
  84.   --
  85.   get the result
  86.   if first char of it is "E" then
  87.     put it into the message box
  88.     beep
  89.     answer "Attempt to install resource has failed."
  90.   else
  91.     beep
  92.     answer "Resource installation successful"
  93.   end if
  94.   hide message window
  95. end mouseUp
  96.  
  97.  
  98.  
  99. -- part contents for background part 2
  100. ----- text -----
  101. DeProtect
  102.  
  103. -- part contents for background part 3
  104. ----- text -----
  105.  
  106. Calling this will let you remove the standard Hypercard protection from any stack.
  107.  
  108.  
  109. Thanks to:
  110. Ned Horvath
  111. Allan Foster
  112.  
  113. -- part contents for background part 10
  114. ----- text -----
  115. Syntax:
  116.  
  117. DeProtect <filename>
  118.  
  119. <filename> is the name of a Hypercard Stack.
  120.  
  121. If no value is returned to result, then deprotection was successful.  
  122. A -44 is a disk locked error.
  123. A -49 is a file busy error.
  124. Other numbers are misc errors.
  125.  
  126. -- part contents for background part 13
  127. ----- text -----
  128. 2